<template>
  <div>
    <!-- 首页图片 -->
    <img src="@/assets/image/1.jpg" width="100%" alt="" />
    <!-- 疫情信息 -->
    <CovInfo :covDesc="covInfo"></CovInfo>
    <!-- 疫情新闻 -->
    <CovNews :news="newsList"></CovNews>
    <!-- 导航栏 -->
    <NavBar></NavBar>
    <!-- 数据统计 -->
    <CovData :covData="covData"></CovData>
    <!-- 地图 -->
    <Map></Map>
    <!-- 轮播图 -->
    <Swiper></Swiper>
  </div>
</template>
<script>
import CovInfo from '@/views/Home/CovInfo.vue'
import CovNews from '@/views/Home/CovNews.vue'
import NavBar from '@/views/Home/NavBar.vue'
import CovData from '@/views/Home/CovData.vue'
import Map from '@/views/Home/map.vue'
import Swiper from '@/views/Swiper/Swiper.vue'
import api from '@/api/index.js'
export default {
  data () {
    return {
      covInfo: {},
      newsList: [],
      covData: {}
    }
  },
  components: {
    CovInfo,
    CovNews,
    NavBar,
    CovData,
    Map,
    Swiper
  },
  computed: {},
  methods: {},
  created () {
    api.getCovInfo().then((res) => {
      const data = res.data.newslist[0].desc
      // 病毒信息
      this.covInfo = {
        note1: data.note1,
        note2: data.note2,
        note3: data.note3,
        remark1: data.remark1,
        remark2: data.remark2,
        remark3: data.remark3
      }
      // 病毒新闻
      this.newsList = res.data.newslist[0].news
      // 数据统计
      /**
            currentConfirmedCount 现存确诊
            confirmedCount  累计确诊
            suspectedCount  累计境外输入人数
            curedCount    累计治愈人数
            deadCount   累计死亡人数
            seriousCount  现存无症状人数
            suspectedIncr  新增境外输入人数
            currentConfirmedIncr   相比昨日现存确诊人数
            confirmedIncr  相比昨日累计确诊人数
            curedIncr   相比昨日新增治愈人数
            deadIncr  相比昨日新增死亡人数
            seriousIncr 相比昨日现存无症状人数

              modifyTime 时间

             */
      this.covData = {
        currentConfirmedCount: data.currentConfirmedCount,
        confirmedCount: data.confirmedCount,
        suspectedCount: data.suspectedCount,
        curedCount: data.curedCount,
        deadCount: data.deadCount,
        seriousCount: data.seriousCount,
        suspectedIncr: data.suspectedIncr,
        currentConfirmedIncr: data.currentConfirmedIncr,
        confirmedIncr: data.confirmedIncr,
        curedIncr: data.curedIncr,
        deadIncr: data.deadIncr,
        seriousIncr: data.seriousIncr,
        modifyTime: data.modifyTime
      }
    })
  },
  mounted () {
    // console.log(this)
  }
}
</script>
<style lang="less" scoped></style>
